// function sum(first, ...arg) {
//     console.log(first);
//     console.log(...arg);
// }
// sum(10, 20, 30);

// const sum = (...args) => {
//     let total = 0;
//     args.forEach(i => {
//         total += i;
//     })
//     // 等价于args.forEach(i => total += i）；
//     return total;
// }
// console.log(sum(10, 20));
// console.log(sum(10, 20, 30));

let students = ['张三', '李四', '王五'];
let [s1,...s2] = students;
console.log(s1);
console.log(...s2);